<style>
.extra-adminlist strong { color:#025A8D; font-size: 1.2em; font-weight: bold; }
table.extra-adminlist .extra-adminlist-tr td {background: #F7F7F7; }
.filter-detail { border-bottom: 1px solid #CCC; padding-bottom: 3px; font-size: 1.4em; }
.filter-detail span { color: #e72222; }
</style>
<?php 
    $complainType = JHTMLwrd::listComplainTypeRaw();
    $mealPeriod = JHTMLwrd::listMealPeriodRaw();
?>
<script type="text/javascript">
jQuery(function(){
    jQuery("#statistic_by").html(jQuery("#statistic_by").html() + " <span style='color:#000;'>Complain Type:</span> " + getSelectedOptionFilter("extra_type")); 
    jQuery("#statistic_by").html(jQuery("#statistic_by").html() + ". <span style='color:#000;'>Meal period:</span> " + getSelectedOptionFilter("extra_meal_period")); 
    jQuery("#statistic_by").html(jQuery("#statistic_by").html() + ". <span style='color:#000;'>Outlet:</span> " + getSelectedOptionFilter("pick_up_at"));    
});

function getSelectedOptionFilter(listName)
{
    var html = "";
    jQuery("#"+listName+" option[selected=selected]").each(function(){
        html = html + jQuery(this).html() + ", ";
    });
    return html.substring(0, html.length-2);
}

</script>
<h3><span id="statistic_by"></span><span style="color:#C00; float:right;">Total: <?php echo $this->pagination->total; ?></span></h3>
<table class="adminlist extra-adminlist table" >
  <thead>
    <tr class="extra-adminlist-tr">
        <th><strong>Member ID</strong></th>        
        <th><strong>Name</strong></th>
		<th><strong>Phone</strong></th>
		<th><strong>Guest Type</strong></th>
        <th><strong>Created Date</strong></th>
         <th><strong>Complaint</strong></th>
        <th><strong>Action Taken</strong></th>
        <th><strong>Complain Type</strong></th>        
        <th><strong>Meal period</strong></th>        
        <th><strong>Outlet</strong></th>  
        <th><strong>Visit Date</strong></th> 
        <th><strong>Handle By</strong></th>
		<th><strong>Table No</strong></th>	
    </tr>
  </thead>
  <tbody>
    <?php 
        if(!empty($this->items)):
            foreach($this->items as $key => $item):
                echo '<tr class="row'.($key%2).'">';
                    echo '<td nowrap="nowrap" style="width:8%;"><a title="Click to view profile" target="_blank" href="index.php?option=com_wrd&controller=profile&id='.$item->profile_id.'&layout=form">'.$item->vip_number.'</a></td>';   
                    echo '<td style="width:14%;"><a title="Click to edit this complain" target="_blank" href="index.php?option=com_wrd&controller=complain&id='.$item->id.'&layout=form">'.$item->l_name.' '.$item->f_name.'</a></td>';   
                     echo '<td nowrap="nowrap"  style="width:8%;">'.$item->phone.'</td>';
					echo '<td nowrap="nowrap"  style="width:8%;">'.$item->guess_type.'</td>';
					
					echo '<td nowrap="nowrap"  style="width:8%;">'.$item->created_date.'</td>';
                    
                    echo '<td>'.$item->complain.'</td>';
                    echo '<td>'.$item->action_taken.'</td>';
                    
                    echo '<td nowrap="nowrap" style="width:10%;">'.$complainType[$item->complain_type].'</td>';   
                    echo '<td nowrap="nowrap" style="width:8%;">'.$mealPeriod[$item->meal_period].'</td>';   
                    echo '<td  style="width:15%;">'.$item->outlet.'</td>';   
                    echo '<td nowrap="nowrap" style="width:8%;">'.$item->visit_date.'</td>';   
                       
                    echo '<td style="width:8%;">'.$item->handle_by.'</td>';
					echo '<td nowrap="nowrap"  style="width:8%;">'.$item->table_no.'</td>';					
                echo '</tr>';
            endforeach;
        endif;
    ?>
    
  </tbody>
  <tfoot>
        <tr>
            <td colspan="16">
                <?php
                     echo $this->pagination->getListFooter();
                ?>
            </td>
        </tr>
    </tfoot>
</table>
